import request from '@/utils/request.js'

// 登录接口
export const loginAPI = function (data) {
  return request.post('/v1_0/authorizations', data)
}

// 获取用户信息
export const getUserInfoAPI = () => {
  return request.get('/v1_0/user')
}

// 获取用户个人介绍
export const getUserProfileAPI = () => {
  return request.get('/v1_0/user/profile')
}

export const uploadAvatorAPI = (data) => {
  return request.patch('/v1_0/user/photo', data)
}

export const updateUserProfileAPI = (obj) => {
  // patch 请求、put 请求类似于 post 请求，它们都有请求体
  return request.patch('/v1_0/user/profile', obj)
}
